package demo06235;

public class Employee {
        private String id;
        private String name;
        private String dept;
        private double salary;

        public Employee(String id, String name, String dept, double salary) {
            this.id = id;
            this.name = name;
            this.dept = dept;
            this.salary = salary;
        }


        public String getId() { return id; }
        public void setId(String id) { this.id = id; }
        public String getName() { return name; }
        public void setName(String name) { this.name = name; }
        public String getDept() { return dept; }
        public void setDept(String dept) { this.dept = dept; }
        public double getSalary() { return salary; }
        public void setSalary(double salary) { this.salary = salary; }


        @Override
        public String toString() {
            return String.format("工号: %-6s 姓名: %-6s 部门: %-8s 薪资: %.2f",
                    id, name, dept, salary);
        }
    }

